import request from '@/config/axios'

export interface verifyTaskTicketVO {
  id: number
  event: string
  ticketCode: string
  taskCode: string
  componentName: string
  drawingType: string
  customerCode: string
  productSpec: string
  productType: string
  productName: string
  drawingContent: string
  changeContent: string
  remarks: string
  verifyOpinion: string
  verifiorName: string
  alerts: []
  baseParams: []
  verifyParams: []
}

// 查询配置中心-部门信息列表(无分页,关键字查询)
export const getDeptList = async (keyword) => {
  return await request.get({ url: `/config/org-dept-archives/list-all-simple?keyword=${keyword}`})
}

// 查询配置中心-人员档案所有数据（名称查询）
export const getStaffList = async (keyword) => {
  return await request.get({ url: `/config/org-staff-archives/list-all-simple?keyword=${keyword}` })
}

// 查询配置中心-班组档案精简数据（名称查询）
export const getTeamList = async (keyword) => {
  return await request.get({ url: `/config/org-team-archives/list-all-simple?keyword=${keyword}` })
}

// 查询配置中心-设备档案精简数据（设备编码查询）
export const getDeviceList = async (keyword) => {
  return await request.get({ url: `/config/device-archives/list-keyword-simple?keyword=${keyword}` })
}

// 查询配置中心-设计人员精简数据（名称查询）
export const getDesignersList = async (keyword) => {
  return await request.get({ url: `/config/drawing-designer/list-all-simple?keyword=${keyword}` })
}

// 查询配置中-制图管理-流程单模板
export const getDrawingProcessTemplate = async (params) => {
  return await request.get({ url: `/config/drawing-process-template/getByProduct`, params })
}

// 查询制图任务单列表
export const getDrawingTaskList = async (params) => {
  return await request.get({ url: `/technology/design-complete-ticket/task/page`, params })
}

//查询配置中心-制图管理-部件档案精简数据（名称查询）
export const getComponentDossierList = async (keyword) => {
  return await request.get({ url: `/config/drawing-component/list-all-simple?keyword=${keyword}` })
}

// 查询技术管理-任务单详情（校对任务单、审核任务单、设计完工单）
export const getTaskTicket = async (id: number) => {
  return await request.get({ url: `/technology/design-complete-ticket/get?id=${id}` })
}

// 提交技术管理-任务单（设计完工单、校对任务单、审核任务单）
export const handleTaskTicket = async (data: verifyTaskTicketVO) => {
  return await request.post({ url: `/technology/design-complete-ticket/commit`, data })
}

// 获取生产管理-过程管理-物料清单
export const getProcessManagementMaterials = async (params) => {
  return await request.get({ url: `/config/material-collect/current-details-plus`, params })
}

// 获取质量管理-质量校验-检验模板名称
export const getQualityInspectReportTemplateName = async (params) => {
  return await request.get({ url: `/config/quality-inspect-report-template/list-all-simple`, params})
}

// 获取质量管理-质量校验-检验模板内容
export const getQualityInspectReportTemplate = async (id: number) => {
  return await request.get({ url: `/config/quality-inspect-report-template/get?id=` + id })
}

// 通过质量管理-质量校验
export const agreeCheckout = async (data) => {
  return await request.put({ url: `/quality/checkout-inspection-conclusion-review/pass`, data })
}

// 查询生产管理-产品管理-发货管理部件列表
export const getProductionShipmentsPartsList = async (params) => {
  return await request.get({ url: `/produce/production-prepare/part/page`, params })
}

// 订单管理-营销管理-发货通知单 查询订单号、产品编号
export const getMarketingShippingNoteProduct = async (params) => {
  return await request.get({ url: `/order/marketing-shipping-note/get-order-project-relations`, params })
}

// 根据产品编号/部件名称 查询图纸图号
export const getDrawingNumberList = async (params) => {
  return await request.get({ url: `/technology/design-alert-ticket/collect/page`, params })
}

// 查询版本历史
export const getPdfFilePage = async (params) => {
  return await request.get({ url: `/technology/dirawing-inventory-detailed-history/versionList`, params })
}

// 查询图纸地址
export const getDrawingFileUrl = async (params) => {
  return await request.get({ url: `/system/pdf-file/listInfo`, params })
}